﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Navigation;
using Microsoft.Phone.Controls;
using Microsoft.Phone.Shell;

namespace Mogubang_Sl.Views
{
    public partial class SocreLifeAddView : UserControl
    {
        public SocreLifeAddView()
        {
            InitializeComponent();
        }

        internal void AddScore(int score, int life, int combo)
        {
            //设置值
            if (combo > 1)
            {
                this.txtCombo.Text = combo.ToString();
                this.stackCombo.Visibility = System.Windows.Visibility.Visible;
            }
            else
            {
                this.stackCombo.Visibility = System.Windows.Visibility.Collapsed;
            }

            if (life > 0)
            {
                this.txtAddLife.Text = life.ToString();
                this.gridLife.Visibility = System.Windows.Visibility.Visible;
            }
            else
            {
                this.gridLife.Visibility = System.Windows.Visibility.Collapsed;
            }

            if (score > 0)
            {
                this.txtAddScore.Text = "+" + score.ToString();
                this.gridScore.Visibility = System.Windows.Visibility.Visible;
            }
            else
            {
                this.gridScore.Visibility = System.Windows.Visibility.Collapsed;
            }

            //动画
            this.StoryboardShow.Begin();
        }
    }
}
